#!/bin/bash

# Set setuid bit on xorg binary, so it can be started by guest user
chmod u+s /usr/lib/xorg/Xorg

# use only white cursors. There were some troubles if the other cursors
# was left behind, installing gtk apps reverted the cursor from white to gray,
# so we're going to nuke it to leave only Snow cursors active.
rm -Rf /usr/share/icons/breeze_cursors 
mv /usr/share/icons/Breeze_Snow /usr/share/icons/breeze_cursors 

(cd /rootcopy-install && cp --parents -afr * /)

# install x11 server utils, apt-get would add cpp dependency, bullshit!
cd /tmp
apt-get download x11-xserver-utils 
ls -la
dpkg -x x11-xserver-utils*.deb /tmp/x11utils 
cd /tmp/x11utils
cp -aR * / 

rm -Rf /usr/share/icons/hicolor/256x256 

if [ $DISTRIBUTION != "orel" ]; then
    update-alternatives --set x-terminal-emulator /usr/bin/xterm 
fi
